home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 21
/
Cream of the Crop 21 (Terry Blount) (October 1996).iso
/
program
/
qbsvga.zip
/
QBSVGA.TXT
< prev
next >
Wrap
Text File
|
1996-08-21
|
29KB
|
530 lines
QBSVGA, version 3.1
"QBSVGA" is a set of subroutines/functions (and an "include file")
that can be used within QB programs to achieve SVGA graphic capability.
Much, but not all, of the standard QB graphic routines are emulated. To
be specific, the QBSVGA routines work best when the video system is not
just SVGA-capable, but VESA-aware as well. (I have yet to encounter an
SVGA-equipped system that is not VESA-aware, but I understand they exist.)
There are included stand-alone routines, VS.EXE and VS1.EXE, that you can
use to determine whether or not your system is VESA-aware and what video
modes you have support for. See VS.TXT for more information concerning
these routines. Whether or not a VESA bios is present on your SVGA card,
you must not only have hardware support for the video mode you want to
use, it must be supported by your VESA bios as well. (It's entirely
possible to have support in hardware for a video mode that your bios
cannot itself access. The routines supplied here do not use direct
hardware access, as opposed to the intrinsic QB graphic routines.) Further,
for the software to auto-detect a VESA video mode, your VESA bios must
provide the so-called extended information about that mode. (VS1 will
tell you whether or not this information is available. If VS1 informs
you that such information is unavailable for any given mode, there is not
necessarily any reason to worry. If QBSVGA fails to find such information
for any one particular mode, it will simply look for another one.)
Most of the documentation regarding the QBSVGA routines can be found
by reading the comments associated with each subroutine/function in
QBSVGA.BAS. This file simply makes some general comments and lists the
functionallity provided by QBSVGA. QBSVGA gives you access to up to 12
different SVGA modes/resolutions:
MODE = 14: 640 x 480 x 256
MODE = 15: 800 x 600 x 16
MODE = 16: 800 x 600 x 256
MODE = 17: 1024 x 768 x 16
MODE = 18: 1024 x 768 x 256
MODE = 19: 1200 x 1024 x 16
MODE = 20: 1200 x 1024 x 256
MODE = 21: 1600 x 1200 x 16
MODE = 22: 1600 x 1200 x 256
MODE = 23: 132 x 25 x 16 (text)
MODE = 24: 132 x 43 x 16 (text)
MODE = 25: 132 x 50 x 16 (text)
The mode integers listed above are the "QB-type" integers that you would
input to QBSVGA's analog of QB's screen statement. They are not necessarily
the actual hex numbers that your bios references (i.e., the video mode
specifiers that QBSVGA, via its subroutine FINDVESA, attempts to auto-
detect). Except for 0, and assuming that auto-detection works, if you try
to use a QB-type mode not specified above, you'll get an 800 x 600 x 16 mode
(if support for it can be found). (Using a mode of 0 produces the same
effect as QB's SCREEN 0 statement.)
The general method of using QBSVGA is to put the contents of
REGTYPE.INC at the top of your program, write your program, calling any
and whichever of the QBSVGA routines you need, and then put the contents of
QBSVGA.BAS at the bottom of your program. When you go to link your
compiled program, be sure and use the auxiliary library QB.LIB in addition
to whatever libraries you normally link with.
The usage syntax of the routines is similar to that with the
corresponding internal QB routines. The QBSVGA routine names are prefixed
with a "B" (for "bios") to distinguish them from their intrinsic QB
analogs. (For the few routines provided that do not emulate specific QB
functions, this convention isn't necessarily followed. Another exception
is MPUT/MGET, previously named BGET/BPUT. There are now *new* BPUT/BGET
subroutines.) One difference between the intrinsic and QBSVGA routines is
that you must not leave out parameters unimportant to you in the calls to the
QBSVGA routines. Another difference is that, except for functions BPOINT and
BPOS, these routines must be accessed via QB's CALL statement. You can put
DECLARE statements at the top of your program if you wish to avoid this
detail, but there is still the matter of enclosing the arguments/parameters
in parentheses. Except for various character string inputs (which should be
obvious), all data passed to the routines should be of type single precision
(real). (BPOINT and QRYMOUSE *return* 2-byte integers.) Example MAIN
routines, SIM.BAS, MOUSDEMO.BAS, and PRTEST.BAS are included to show the
basic usage of the routines. (You may of course wish to read the commentary
and inspect the SUB/FUNCTION statements themselves in QBSVGA.BAS.)
The rest of this file gives a basic description of the different
routines supplied in QBSVGA.BAS.
SUB BSCREEN: analog of QB's SCREEN statement
(QB's SCREEN function is not emulated here. BSCREEN will
not change the video mode if the screen is already in the
mode you're requesting. In this situation, BSCREEN serves
merely to change active and displayed video pages.
Exceptions to this are when your inputting a video mode of 0
to BSCREEN, to achieve the same effect as QB's SCREEN 0
statement, or when auto-mode detection failed and you get
prompted for the bios video mode to use--see below. BSCREEN
should be called before any of the other routines--and then
again with a QB-type mode of 0 when you're all done.)
SUB BPSET: analog of QB's PSET statement
SUB BLINE: analog of QB's LINE statement
(QB's style option is not supported.)
SUB BCIRCLE: analog of QB's CIRCLE statement
SUB BCLS: analog of QB's CLS 0 and CLS 1 statements
(CLS 2 is not supported.)
SUB BCOLOR: analog of QB's COLOR statement
SUB BLOCATE: analog of QB's LOCATE statement
(LOCATE's cursor control options are not included.)
SUB BPRINT: analog of QB's PRINT statement
(See QBSVGA.BAS for discussion of differences in how this
routine formats output.)
FUNCTION BPOINT%: analog of QB's POINT function
(Note that BPOINT is a 2-byte INTEGER.)
SUB BVIEW: analog of QB's graphics VIEW statement
(The SCREEN option of VIEW is not supported and its performance
is somewhat limited when its border encroaches on a screen edge.)
SUB BPAINT: a not necessarily exact analog of QB's PAINT statement
(You should be able to use this subroutine to achieve the
same results that PAINT would give if it applied to SVGA
video modes. However, especially when painting the exterior
of objects, you may need to make multiple calls to BPAINT
with different (x,y) inputs. Also, painting only occurs in
regions in which the pixel color is the same as the background.
The background color is either 0 or it is the color of whatever
the viewport (if active) was filled with. (PAINT's tiling option
is not supported.) Also, BPAINT may at times perform better if
the coordinate you specify isn't directly adjacent to a pixel
bordering the area you're painting. These slight idiosyncracies
are perhaps offset by a difference between BPAINT and PAINT
that may make BPAINT somewhat better. PAINT will not let you,
for example, paint the inside of a circle with a different color
than used to draw the circle. If you try, the painting will
progress outside of the circle until pixels of the painting
color or the screen/viewport edge are encountered. BPAINT
doesn't perform that way. BPAINT has no problems with your
drawing a circle (or any closed object) with one color and
painting its interior with an another.)
FUNCTION BPOS: an emulation of QB's POS *and* CRSLIN functions
(The current line, or row, is returned via the argum